package student;


import java.util.Arrays;

public class StudentArray {
    private Student[] students;
    private int MAX_SIZE = 10;
    private int usedSize;
    public StudentArray(){
      students = new Student[MAX_SIZE];
      usedSize = 0;
    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }
    public Student getStudent(int pos){
        return students[pos];
    }
    public Student[] getStudent(){
        return students;
    }
    public void setStudent(int pos,Student stu){
        students[pos] = stu;
    }
    public int getMAX_SIZE(){
        return MAX_SIZE;
    }
    public void setMAX_SIZE(int n){
        MAX_SIZE = n;
    }
    public boolean Dilatation(){
        if(MAX_SIZE == usedSize){
            students = Arrays.copyOf(students,MAX_SIZE*2);
            MAX_SIZE *= 2;
            return true;
        }
        return false;
    }
}
